package com.lyc.service;



import org.junit.Test;

import com.alibaba.fastjson.JSON;
import com.lyc.dto.AuthDto;
import com.lyc.service.impl.AdminServiceImpl;

public class AdminServiceTest {

	private AdminService adminservice = new AdminServiceImpl();
	
	@Test
	public void login() {
		try {
			System.out.println("测试成功");
			AuthDto auth = adminservice.login("admin", "123");
			System.out.println(JSON.toJSONString(auth,true));
		}catch(Exception ex) {
			ex.printStackTrace();
		}
		
		
		try {
			System.out.println("测试用户名错误");
			AuthDto auth = adminservice.login("admin12312321", "123");
			System.out.println(JSON.toJSONString(auth,true));
		}catch(Exception ex) {
			ex.printStackTrace();
		}
		
		
		try {
			System.out.println("密码错误");
			AuthDto auth = adminservice.login("admin", "12ejkljd2343");
			System.out.println(JSON.toJSONString(auth,true));
		}catch(Exception ex) {
			ex.printStackTrace();
		}
	}
}
